# -*- coding:utf-8 -*-
# @Time:2024/4/1921:01
# @Author:miuzg
# @FileName:new test2.py
# @Software:PyCharm

import time


def get_time(fun):
    def calc_time(*args, **kwargs):
        start_time = time.time()
        res = fun(*args, **kwargs)
        end_time = time.time()
        print('执行时间为', end_time - start_time)
        return res

    return calc_time


# 判断是否为质数
def work(num):
    if num < 2:
        return False
    for i in range(2, num):
        if num % i == 0:
            return False
    return True


@get_time
def no_process():
    res = []
    for i in range(1, 100001):
        print(i)
        if work(i):
            res.append(i)
    print(sum(res))

if __name__ == '__main__':
    no_process()

